package com.itheima.api2;

import java.util.Arrays;

public class Demo3 {
    public static void main(String[] args) {
        int[] arr={1,2,3,4,5};
       int newarr[]=Arrays.copyOf(arr,10);
        System.out.println(Arrays.toString(newarr));
        System.out.println("-----------------------");
        int[] newarr1=new int[10];
        System.arraycopy(arr,0,newarr1,0,5);
        System.out.println(Arrays.toString(newarr1));

    }
}
